#ifndef RTE_KB1267_MEM_BLOCK_H
#define RTE_KB1267_MEM_BLOCK_H

#include <logger_rte.h>

using byte = unsigned char;

class mem_block {

public:
    virtual ~mem_block() = default;

    virtual void Remove(int i) = 0;

    virtual int Read(unsigned char block, unsigned int i, unsigned int i1, void *pVoid) = 0;

    virtual int Shutdown() {
        return 0;
    };

    virtual void Write(unsigned char block, unsigned int start, void *pVoid, unsigned int len) = 0;

    virtual void begin(const char *name, int sz) = 0;

    virtual int begin(byte *name, byte name_sz, uint32_t start_address, uint32_t data_len) = 0;

    virtual int begin_read(byte *name, byte name_sz, uint32_t start_address, uint32_t data_len) = 0;

    virtual int Write(byte *, int);;
    static mem_block *mems[];

    virtual const char *name() = 0;

    uint32_t length();
};

#endif // RTE_KB1267_MEM_BLOCK_H
